package cn.caplike.demo.google.protobuf.with_netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * Description: 客户端.
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2021-12-01 13:15
 */
public class TestClientChannelInboundHandler extends SimpleChannelInboundHandler<MyDataInfo.Person> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MyDataInfo.Person msg) {

    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        final MyDataInfo.Person person = MyDataInfo.Person.newBuilder().setName("哦哦").setAge(20).setAddress("一个地址").build();
        ctx.channel().writeAndFlush(person);
    }
}
